package org.sump.ui.gwt.forms.client;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;

import com.gwtent.client.aop.intercept.MethodInvocation;

@Aspect
public class PersonAspect {
	@After("execution(* **.get*())")
    public void afterCall(MethodInvocation invocation) {                            
        System.out.println("Do something in " + invocation.getMethod().getName() + ", After...");
            for (Object arg : invocation.getArguments()){
                    
                    if (arg instanceof Number)
                            System.out.println("After Call: " + arg);
            }
    }

	@After("execution(* org.sump.ui.gwt.forms.client.Person.get*())")
    public void afterCall2(MethodInvocation invocation) {                            
        System.out.println("2. Do something in " + invocation.getMethod().getName() + ", After...");
            for (Object arg : invocation.getArguments()){
                    
                    if (arg instanceof Number)
                            System.out.println("2. After Call: " + arg);
            }
    }

	@After("execution(* org.sump.ui.gwt.forms.client.Person.getFirstName())")
    public void afterCall3(MethodInvocation invocation) {                            
        System.out.println("3. Do something in " + invocation.getMethod().getName() + ", After...");
            for (Object arg : invocation.getArguments()){
                    
                    if (arg instanceof Number)
                            System.out.println("3. After Call: " + arg);
            }
    }

}
